<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">

    <title>Dashboard | Nifty - Admin Template</title>
    <link href='https://fonts.googleapis.com/css?family=Open+Sans:400,300,600,700' rel='stylesheet' type='text/css'>
    <link href="../../static/backstage/css/bootstrap.min.css" rel="stylesheet">
    <link href="../../static/backstage/css/nifty.min.css" rel="stylesheet">
    <link href="../../static/backstage/css/demo/nifty-demo-icons.min.css" rel="stylesheet">
    <link href="../../static/backstage/plugins/pace/pace.min.css" rel="stylesheet">
    <script src="../../static/backstage/plugins/pace/pace.min.js"></script>
    <link href="../../static/backstage/css/demo/nifty-demo.min.css" rel="stylesheet">
    <script src="../../static/backstage/lib/layui/layui.js" charset="utf-8"></script>
    <link rel="stylesheet" href="../../static/backstage/css/font.css">
    <link rel="stylesheet" href="../../static/backstage/css/xadmin.css">
    <link rel="stylesheet" href="../../static/backstage/css/zTreeStyle.css">

    <style>
        .treebox {
            width: 300px;
            position: relative;
            left: 0;
            right: 0;
            top: 200px;
            bottom: 0;
            margin: auto;
        }
        .wrap {
            text-align: center;
        }
        .ztree {
            padding-left: 200px;
            padding-top: 50px;
        }
        .ztree li span.button {
            background-position-x: -144px;
            background-position-y: -1px;
        }
    </style>

<body>

        <nav id="mainnav-container" th:fragment="left(type)">
            <div id="mainnav">

                <!--Menu-->
                <!--================================-->
                <div id="mainnav-menu-wrap">
                    <div class="nano">
                        <div class="nano-content">
                            <!--Shortcut buttons-->
                            <!--================================-->
                            <div id="mainnav-shortcut" class="hidden">
                                <ul class="list-unstyled shortcut-wrap">
                                    <li class="col-xs-3" data-content="My Profile">
                                        <a class="shortcut-grid" href="#">
                                            <div class="icon-wrap icon-wrap-sm icon-circle bg-mint">
                                                <i class="demo-pli-male"></i>
                                            </div>
                                        </a>
                                    </li>
                                    <li class="col-xs-3" data-content="Messages">
                                        <a class="shortcut-grid" href="#">
                                            <div class="icon-wrap icon-wrap-sm icon-circle bg-warning">
                                                <i class="demo-pli-speech-bubble-3"></i>
                                            </div>
                                        </a>
                                    </li>
                                    <li class="col-xs-3" data-content="Activity">
                                        <a class="shortcut-grid" href="#">
                                            <div class="icon-wrap icon-wrap-sm icon-circle bg-success">
                                                <i class="demo-pli-thunder"></i>
                                            </div>
                                        </a>
                                    </li>
                                    <li class="col-xs-3" data-content="Lock Screen">
                                        <a class="shortcut-grid" href="#">
                                            <div class="icon-wrap icon-wrap-sm icon-circle bg-purple">
                                                <i class="demo-pli-lock-2"></i>
                                            </div>
                                        </a>
                                    </li>
                                </ul>
                            </div>
                            <!--================================-->
                            <!--End shortcut buttons-->


                            <ul id="mainnav-menu" class="list-group">

                                <!--Category name-->
                                <li class="list-header">Navigation</li>

                                <!--Menu list item-->
                                <!--<li>
                                    <a href="/backstage/index">
                                        <i class="demo-pli-home"></i>
                                        <span class="menu-title">分类管理</span>

                                    </a>
                                </li>-->
                                <li th:class="${type==1}?'active-sub':''">
                                    <a href="/backstage/article">
                                        <i class="demo-pli-split-vertical-2"></i>
                                        <span class="menu-title">文章管理</span>

                                    </a>
                                    </li>
                                <li th:class="${type==2}?'active-sub':''">
                                    <a href="/backstage/user">
                                        <i class="demo-pli-gear"></i>
                                        <span class="menu-title">
                                                用户管理
                                            </span>
                                    </a>
                                </li>
                                <li th:class="${type==3}?'active-sub':''">
                                    <a href="/backstage/dictionary">
                                        <i class="demo-pli-pen-5"></i>
                                        <span class="menu-title">基本字典管理</span>
                                    </a>
                                </li>
                                <!--
                                <li>
                                    <a href="#">
                                        <i class="demo-pli-repair"></i>
                                        <span class="menu-title">关键字管理</span>

                                    </a>

                                </li>-->
                                <li th:class="${type==4}?'active-sub':''">
                                    <a href="/backstage/buy/selectAll">
                                        <i class="demo-pli-warning-window"></i>
                                        <span class="menu-title">购买记录</span>

                                    </a>
                                </li>
                                <!--Menu list item-->
                                <li th:class="${type==5}?'active-sub':''">
                                    <a href="/backstage/sponsor/toSponsor">
                                        <i class="demo-pli-computer-secure"></i>
                                        <span class="menu-title">赞助编辑</span>

                                    </a>

                                </li>
                                <li th:class="${type==6}?'active-sub':''">
                                    <a href="/backstage/loginSetting">
                                        <i class="demo-pli-boot-2"></i>
                                        <span class="menu-title">登录信息管理</span>

                                    </a>
                                </li>
                                <li th:class="${type==7}?'active-sub':''">
                                    <a href="/backstage/comm/selectAllList">
                                        <i class="demo-pli-repair"></i>
                                        <span class="menu-title">评论管理</span>

                                    </a>
                                </li>
                                <li th:class="${type==8}?'active-sub':''">
                                    <a href="/backstage/friendLink">
                                        <i class="demo-pli-repair"></i>
                                        <span class="menu-title">友情链接</span>

                                    </a>
                                </li>
                                <li th:class="${type==9}?'active-sub':''">
                                    <a href="/backstage/advertising">
                                        <i class="demo-pli-repair"></i>
                                        <span class="menu-title">广告管理</span>

                                    </a>
                                </li>
                            </ul>


                        </div>
                    </div>
                </div>
                <!--================================-->
                <!--End menu-->
            </div>

            <script>


                $('#mainnav-menu li').on('click',function () {
                    $('#mainnav-menu li').removeClass('active-sub');
                    $(this).addClass('active-sub');
                })


                //查找字典项
                function findlables(dictionaryId,domId) {
                    $.ajax({
                        url: '/download/item/itemList',
                        type: 'post',
                        data: {"dictionaryId": dictionaryId},
                        // contentType: 'application/json',
                        success: function (res) {
                            var lable_select='<option value="">请选择</option>';
                            // var lable_select='';
                            $.each(res,function(i,n){
                                if(i==0){
                                    lable_select+=`<option value="${n.id}" selected="selected"> ${n.value} </option>`;
                                }else {
                                    lable_select += `<option value="${n.id}"> ${n.value} </option>`;
                                }
                            });
                            $(domId).html(lable_select);
                        }
                    });
                }
                function renderForm(){
                    layui.use('form', function(){
                        var form = layui.form;
                        form.render();
                    });
                }

            </script>





        </nav>
        <!--===================================================-->
        <!--END MAIN NAVIGATION-->

    </div>

    <!-- SCROLL PAGE BUTTON -->
    <!--===================================================-->
    <button class="scroll-top btn">
        <i class="pci-chevron chevron-up"></i>
    </button>

</body>

</html>